package com.hxzy.drvier.api;

import com.hxzy.common.util.R;
import com.hxzy.drvier.api.fallback.DriverOpenFeignFallbackFactory;
import com.hxzy.drvier.req.CreateDriverFaceModelReq;
import com.hxzy.drvier.req.UpdateDriverAuthReq;
import com.hxzy.drvier.resp.DriverResp;
import com.hxzy.drvier.req.RegisterNewDriverReq;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Map;

/**
 * @Author wy
 * @Description 定义司机端 共享远程服务的接口    OpenFeign=服务发现 + Ribbon + RestTemplate + SpringMVC
 * @Date 2023/12/13 9:32
 * @Version 1.0
 */
@FeignClient(name = "hxds-driver",fallbackFactory = DriverOpenFeignFallbackFactory.class)
public interface DriverOpenFeignApi {

    /** 获取司机的信息
     * @param driverId
     * @return
     */
    @GetMapping("/driver/info/{driverId}")
    R<DriverResp>  getDriverInfo(@PathVariable(value = "driverId") long driverId);


    /**
     * 司机注册
     * @param req
     * @return
     */
    @PostMapping("/driver/registerNewDriver")
    R<Map<String,String>> registerNewDriver(@RequestBody RegisterNewDriverReq req);

    /**
     * 司机实名认证
     * @param req
     * @return
     */
    @PostMapping(value = "/driver/updateDriverAuth")
    R<Integer> updateDriverAuth(@RequestBody UpdateDriverAuthReq req);

    /**
     * 创建司机人脸模型归档
     * @param req
     * @return
     */
    @PostMapping(value = "/driver/createDriverFaceModel")
    R<Map<String,String>>  createDriverFaceModel(@RequestBody CreateDriverFaceModelReq req);


}
